﻿// src/crudOption/service/serviceList.js
export default () => {
  // ===== 搜索 =====
  const searchOption = ref({
    formConfig: {
      // 消费时间
      createTime: {
        label: "消费时间",
        component: "el-date-picker",
        type: "daterange",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      // 消费对象
      consumer: {
        label: "消费对象",
      },
      // 操作人员
      operator: {
        label: "操作人员",
      },
    },
  });

  // ===== 表格/表单 =====
  const tableOption = ref(
    Utils.tools.deleteSearchConfig({
      dialogWidth: "35%", // 20% 在窄屏可能太小，这里给个像素更稳；按需改回
      align: "left",
      menu: false,
      menuWidth: 100,
      addBtn: false,
      editBtn: false,
      delBtn: false,
      /**
       * 列表列
       */
      column: {
        execTime: { label: "消费时间", minWidth: 200, display: false },

        fee: { label: "消费金额(元)", minWidth: 160, display: false },

        profit: { label: "利润金额(元)", minWidth: 160, display: false },

        consumerName: { label: "消费对象", minWidth: 160, display: false },

        consumerAccount: { label: "扣款账户", minWidth: 200, display: false },

        operator: {
          label: "操作人员",
          minWidth: 120,
          addDisplay: false,
          editDisplay: false,
        },
      },
    })
  );

  return { searchOption, tableOption };
};
